home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
m68k
/
cc68k.arc
/
SIEVE.ARC
/
SIEVE.S
< prev
Wrap
Text File
|
1989-11-05
|
1KB
|
70 lines
SECTION 9
MAIN:
LINK A6,#-8212
MOVEM.L D3/D4/D5/D6/D7/A2,-(A7)
LEA -8191(A6),A0
MOVE.L A0,A2
MOVE.L #8190,D7
MOVE.L #L_0,-(A7)
JSR PRINTF
ADD.W #4,A7
MOVE.L #1,-8212(A6)
L_2:
MOVE.L -8212(A6),D0
CMP.L #10,D0
BGT L_3
MOVE #0,D5
MOVE #0,D3
L_4:
CMP.L D7,D3
BGT L_5
MOVE.B #1,0(A2,D3.L)
ADD.L #1,D3
BRA L_4
L_5:
MOVE #0,D3
L_6:
CMP.L D7,D3
BGT L_7
TST.B 0(A2,D3.L)
BEQ L_8
MOVE.L D3,D0
ADD.L D3,D0
ADD.L #3,D0
MOVE.L D0,D6
MOVE.L D3,D0
ADD.L D6,D0
MOVE.L D0,D4
L_10:
CMP.L D7,D4
BGT L_11
CLR.B 0(A2,D4.L)
ADD.L D6,D4
BRA L_10
L_11:
MOVE.L D5,D0
ADD.L #1,D0
MOVE.L D0,D5
L_8:
ADD.L #1,D3
BRA L_6
L_7:
ADD.L #1,-8212(A6)
BRA L_2
L_3:
MOVE.L D5,-(A7)
MOVE.L #L_1,-(A7)
JSR PRINTF
ADD.W #8,A7
L_12:
MOVEM.L (A7)+,D3/D4/D5/D6/D7/A2
UNLK A6
RTS
L_1:
DC.B 10,37,100,32,112,114,105,109,101,115,10,0
L_0:
DC.B 49,48,32,105,116,101,114,97,116,105,111,110
DC.B 115,10,0
XDEF MAIN
XREF PRINTF
END